package cn.edu.scau.cmi.liujianxun.composite.safe;

import java.util.ArrayList;
import java.util.HashSet;

public class Organization implements Component{
	
	private HashSet<Component> mySet = new HashSet<Component>();
	private String name;
	
	public Organization(String name) {
		this.name = name;
	}
	
	@Override
	public String operation() {
		return "我是一个组织，我的名字是" + this.name;
	}
	
	@Override
	public String getName() {
		return this.name;
	}

	public boolean add(Component c) {
		return mySet.add(c);
	}
	
	public boolean remove(Component c) {
		return mySet.remove(c);
	}
	
	public HashSet<Component> getSet() {
		return mySet;
	}
}
